package com.ruoyi.fep.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fep.mapper.BuyersMapper;
import com.ruoyi.fep.domain.Buyers;
import com.ruoyi.fep.service.IBuyersService;

/**
 * 基本信息Service业务层处理
 * 
 * @author zj
 * @date 2023-04-12
 */
@Service
public class BuyersServiceImpl implements IBuyersService 
{
    @Autowired
    private BuyersMapper buyersMapper;

    /**
     * 查询基本信息
     * 
     * @param buyerId 基本信息主键
     * @return 基本信息
     */
    @Override
    public Buyers selectBuyersByBuyerId(Long buyerId)
    {
        return buyersMapper.selectBuyersByBuyerId(buyerId);
    }

    /**
     * 查询基本信息列表
     * 
     * @param buyers 基本信息
     * @return 基本信息
     */
    @Override
    public List<Buyers> selectBuyersList(Buyers buyers)
    {
        return buyersMapper.selectBuyersList(buyers);
    }

    /**
     * 新增基本信息
     * 
     * @param buyers 基本信息
     * @return 结果
     */
    @Override
    public int insertBuyers(Buyers buyers)
    {
        buyers.setCreateTime(DateUtils.getNowDate());
        return buyersMapper.insertBuyers(buyers);
    }

    /**
     * 修改基本信息
     * 
     * @param buyers 基本信息
     * @return 结果
     */
    @Override
    public int updateBuyers(Buyers buyers)
    {
        buyers.setUpdateTime(DateUtils.getNowDate());
        return buyersMapper.updateBuyers(buyers);
    }

    /**
     * 批量删除基本信息
     * 
     * @param buyerIds 需要删除的基本信息主键
     * @return 结果
     */
    @Override
    public int deleteBuyersByBuyerIds(Long[] buyerIds)
    {
        return buyersMapper.deleteBuyersByBuyerIds(buyerIds);
    }

    /**
     * 删除基本信息信息
     * 
     * @param buyerId 基本信息主键
     * @return 结果
     */
    @Override
    public int deleteBuyersByBuyerId(Long buyerId)
    {
        return buyersMapper.deleteBuyersByBuyerId(buyerId);
    }
}
